home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / python-support / gnome-games-data / glchess / defaults.py < prev    next >
Encoding:
Python Source  |  2009-04-14  |  4.3 KB  |  90 lines

  1. # -*- coding: utf-8 -*-
  2. #
  3. # defaults.py.in sets many important default global variables
  4. # used throughout the game. Note that this file is processed by
  5. # automake to set prefix paths etc. Please keep defaults.py.in
  6. # in sync between glchess and gnome-sudoku. 
  7.  
  8. import os, os.path
  9. import errno
  10. import gettext 
  11.  
  12. root_dir = os.path.dirname(__file__)
  13. if not os.path.exists(os.path.join(root_dir, 'Makefile.am')):
  14.     # Running in installed mode
  15.     APP_DATA_DIR     = os.path.join('/usr', 'share') 
  16.     ICON_DIR         = os.path.join(APP_DATA_DIR, 'pixmaps')
  17.     TEXTURE_DIR      = os.path.join(ICON_DIR, 'glchess')
  18.     GLADE_DIR        = os.path.join(APP_DATA_DIR, 'glchess')
  19.     BASE_DIR         = os.path.join(APP_DATA_DIR, 'glchess')
  20.     LOCALEDIR        = os.path.join(APP_DATA_DIR, 'locale')
  21.     DATA_DIR         = os.path.expanduser('~/.gnome2/glchess/')
  22.     LOG_DIR          = os.path.join(DATA_DIR, 'logs')
  23.     CONFIG_FILE      = os.path.join(DATA_DIR, 'config.xml')
  24.     HISTORY_DIR      = os.path.join(DATA_DIR, 'history')
  25.     UNFINISHED_FILE  = os.path.join(HISTORY_DIR, 'unfinished')
  26.     LOCAL_AI_CONFIG  = os.path.join(DATA_DIR, 'ai.xml')
  27.     GGZ_DIR          = os.path.expanduser('~/.ggz')
  28.     GGZ_CONFIG_FILE  = os.path.join(GGZ_DIR, 'ggz-gtk.rc')
  29. else:
  30.     # Running in uninstalled mode
  31.     APP_DATA_DIR     = os.path.join(root_dir, '../../data')
  32.     ICON_DIR         = os.path.join(root_dir, '../../textures')
  33.     TEXTURE_DIR      = os.path.join(root_dir, '../../textures')
  34.     GLADE_DIR        = os.path.join(root_dir, '../../glade')
  35.     BASE_DIR         = os.path.join(root_dir, '../../data')
  36.     LOCALEDIR        = os.path.join(APP_DATA_DIR, 'locale')
  37.     DATA_DIR         = os.path.expanduser('~/.gnome2/glchess/')
  38.     LOG_DIR          = os.path.join(DATA_DIR, 'logs')
  39.     CONFIG_FILE      = os.path.join(DATA_DIR, 'config.xml')
  40.     HISTORY_DIR      = os.path.join(DATA_DIR, 'history')
  41.     UNFINISHED_FILE  = os.path.join(HISTORY_DIR, 'unfinished')
  42.     LOCAL_AI_CONFIG  = os.path.join(DATA_DIR, 'ai.xml')
  43.     GGZ_DIR          = os.path.expanduser('~/.ggz')
  44.     GGZ_CONFIG_FILE  = os.path.join(GGZ_DIR, 'ggz-gtk.rc')
  45.  
  46. DOMAIN = 'gnome-games'
  47. gettext.bindtextdomain(DOMAIN, LOCALEDIR)
  48. gettext.textdomain(DOMAIN)
  49. from gettext import gettext as _
  50.  
  51. import gtk.glade
  52. gtk.glade.bindtextdomain(DOMAIN, LOCALEDIR)
  53. gtk.glade.textdomain(DOMAIN)
  54.  
  55. VERSION   = "2.26.1"
  56. APPNAME   = _("glChess")
  57. ICON_NAME = 'gnome-glchess'
  58.  
  59. COPYRIGHT     = _('Copyright 2005-2008 Robert Ancell (and contributors)')
  60. DESCRIPTION   = _('The 2D/3D chess game for GNOME. \n\nglChess is a part of GNOME Games.')
  61. WEBSITE       = 'http://www.gnome.org/projects/gnome-games/'
  62. WEBSITE_LABEL = _('GNOME Games web site')
  63. AUTHORS       = ['Robert Ancell <bob27@users.sourceforge.net>\n'
  64.          'Andreas R√∏sdal <andreasr@gnome.org>']
  65. ARTISTS       = ['John-Paul Gignac (3D Models)', 'Max Froumentin (2D Models)', 'Hylke Bons <h.bons@student.rug.nl> (icon)']
  66.  
  67. # The GPL license string will be translated, and the game name inserted.
  68. # This license is the same as in libgames-support/games-stock.c 
  69. LICENSE = [_("%s is free software; you can redistribute it and/or modify " 
  70.        "it under the terms of the GNU General Public License as published by " 
  71.        "the Free Software Foundation; either version 2 of the License, or " 
  72.        "(at your option) any later version.").replace("%s", APPNAME),
  73. _("%s is distributed in the hope that it will be useful, "
  74.        "but WITHOUT ANY WARRANTY; without even the implied warranty of "
  75.        "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
  76.        "GNU General Public License for more details.").replace("%s", APPNAME),
  77. _("You should have received a copy of the GNU General Public License "
  78.        "along with %s; if not, write to the Free Software Foundation, Inc., "
  79.        "51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA").replace("%s", APPNAME)]
  80.  
  81. # License for 2D models is the following, which is GPL compatible, and therefore not included in the license dialog:
  82. #2D Models:
  83. #Copyright World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/"""
  84.  
  85. try:
  86.     os.makedirs(DATA_DIR)
  87. except OSError, e:
  88.     if e.errno != errno.EEXIST:
  89.        print _('Unable to make data directory %(dir)s: %(error)s') % {'dir': DATA_DIR, 'error': e.strerror}
  90.